home *** CD-ROM | disk | FTP | other *** search
- ;STRRNCHR - Search for matching character.
- ; char *strrnchr(addr: address; len: integer; pat: char);
-
- ; This is like strrchr (=rindex) except that it works with fixed length
- ; strings.
-
- cseg
- public strrnchr_
-
- strrnchr_:pop bx
- pop di ;start address
- pop cx ;length
- pop ax ;character to match
- push ax
- push cx
- push di
- push bx
-
- std
- push ds
- pop es
- add di,cx
- dec di ;sets nonzero status
- repne scasb
- jne s1 ;if not found
- inc di ;if found, back up
- s1: xchg ax,di
- ret
- end